﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Diagnostics;
using System.ServiceModel.Web;

namespace ControlService
{
    /// <summary>
    /// 用于版本文件下载的契约
    /// </summary>
    public class FileDownContract : IFileDownContract
    {
        [WebInvoke(Method = "*", UriTemplate = "A?B={b}")]
        public System.IO.Stream A(string b)
        {
            string runDir = System.Environment.CurrentDirectory;
            string imgFilePath = System.IO.Path.Combine(runDir, "ClientUpdateFiles/" + b);
            System.IO.FileStream fs = new System.IO.FileStream(imgFilePath, System.IO.FileMode.Open);
            System.Threading.Thread.Sleep(2000);
            //WebOperationContext.Current.OutgoingResponse.ContentType = "image/jpeg";
            return fs;
        }
    }
}
